home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / modes / pike.xml < prev    next >
Extensible Markup Language  |  2013-07-28  |  7KB  |  242 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!-- Pike mode, contributed by
  4.                       Marco G?tze, <gomar@gmx.net> -->
  5. <!-- Small fixes and autodoc support contributed by
  6.                       Peter Lundqvist <peterl@update.uu.se> -->
  7.  
  8. <!DOCTYPE MODE SYSTEM "xmode.dtd">
  9.  
  10. <MODE>
  11.   <PROPS>
  12.     <PROPERTY NAME="commentStart" VALUE="/*"/>
  13.     <PROPERTY NAME="commentEnd" VALUE="*/"/>
  14.     <PROPERTY NAME="lineComment" VALUE="//"/>
  15.     <PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*`"/>
  16.  
  17.     <!-- Auto indent -->
  18.     <PROPERTY NAME="indentOpenBrackets" VALUE="{"/>
  19.     <PROPERTY NAME="indentCloseBrackets" VALUE="}"/>
  20.     <PROPERTY NAME="indentNextLine" VALUE="\s*(((if|(for(each)?)|while|catch|gauge)\s*\(|(do|else)\s*|else\s+if\s*\()[^{;]*)"/>
  21.     <!-- set this to 'true' if you want to use GNU coding style -->
  22.     <PROPERTY NAME="doubleBracketIndent" VALUE="false"/>
  23.   </PROPS>
  24.   <RULES IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="(0x[\p{XDigit}]+|[\p{Digit}]+|0[bB][01]+)[lLdDfF]?">
  25.  
  26.     <!-- comments -->
  27.     <SPAN TYPE="COMMENT1" DELEGATE="COMMENT">
  28.       <BEGIN>/*</BEGIN>
  29.       <END>*/</END>
  30.     </SPAN>
  31.     <SEQ TYPE="INVALID">*/</SEQ>
  32.  
  33.     <!-- Autodoc comment -->
  34.     <EOL_SPAN TYPE="COMMENT1" DELEGATE="AUTODOC">//!</EOL_SPAN>
  35.     <!-- C++ line comment -->
  36.     <EOL_SPAN TYPE="COMMENT1" DELEGATE="COMMENT">//</EOL_SPAN>
  37.  
  38.     <!-- string, char literals -->
  39.     <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" DELEGATE="STRING_LITERAL">
  40.       <BEGIN>"</BEGIN>
  41.       <END>"</END>
  42.     </SPAN>
  43.     <SPAN TYPE="LITERAL1" DELEGATE="STRING_LITERAL">
  44.       <BEGIN>#"</BEGIN>
  45.       <END>"</END>
  46.     </SPAN>
  47.     <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
  48.       <BEGIN>'</BEGIN>
  49.       <END>'</END>
  50.     </SPAN>
  51.  
  52.     <!-- preprocessor statements -->
  53.     <SEQ_REGEXP TYPE="KEYWORD2" HASH_CHAR="#" AT_LINE_START="TRUE">#.*?(?=($|/\*|//))</SEQ_REGEXP>
  54.  
  55.     <!-- operators -->
  56.     <SEQ TYPE="OPERATOR">({</SEQ>
  57.     <SEQ TYPE="OPERATOR">})</SEQ>
  58.     <SEQ TYPE="OPERATOR">([</SEQ>
  59.     <SEQ TYPE="OPERATOR">])</SEQ>
  60.     <SEQ TYPE="OPERATOR">(<</SEQ>
  61.     <SEQ TYPE="OPERATOR">>)</SEQ>
  62.     <SEQ TYPE="OPERATOR">=</SEQ>
  63.     <SEQ TYPE="OPERATOR">!</SEQ>
  64.     <SEQ TYPE="OPERATOR">+</SEQ>
  65.     <SEQ TYPE="OPERATOR">-</SEQ>
  66.     <SEQ TYPE="OPERATOR">/</SEQ>
  67.     <SEQ TYPE="OPERATOR">*</SEQ>
  68.     <SEQ TYPE="OPERATOR">></SEQ>
  69.     <SEQ TYPE="OPERATOR"><</SEQ>
  70.     <SEQ TYPE="OPERATOR">%</SEQ>
  71.     <SEQ TYPE="OPERATOR">&</SEQ>
  72.     <SEQ TYPE="OPERATOR">|</SEQ>
  73.     <SEQ TYPE="OPERATOR">^</SEQ>
  74.     <SEQ TYPE="OPERATOR">~</SEQ>
  75.     <SEQ TYPE="OPERATOR">@</SEQ>
  76.     <SEQ TYPE="OPERATOR">`</SEQ>
  77.     <SEQ TYPE="OPERATOR">.</SEQ>
  78.  
  79.     <!-- function calls -->
  80.     <MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS>
  81.     <SEQ TYPE="OPERATOR">)</SEQ>
  82.  
  83.     <KEYWORDS>
  84.       <!-- type modifiers -->
  85.       <KEYWORD1>constant</KEYWORD1>
  86.       <KEYWORD1>extern</KEYWORD1>
  87.       <KEYWORD1>final</KEYWORD1>
  88.       <KEYWORD1>inline</KEYWORD1>
  89.       <KEYWORD1>local</KEYWORD1>
  90.       <KEYWORD1>nomask</KEYWORD1>
  91.       <KEYWORD1>optional</KEYWORD1>
  92.       <KEYWORD1>private</KEYWORD1>
  93.       <KEYWORD1>protected</KEYWORD1>
  94.       <KEYWORD1>public</KEYWORD1>
  95.       <KEYWORD1>static</KEYWORD1>
  96.       <KEYWORD1>variant</KEYWORD1>
  97.  
  98.       <!-- types -->
  99.       <KEYWORD3>array</KEYWORD3>
  100.       <KEYWORD3>class</KEYWORD3>
  101.       <KEYWORD3>float</KEYWORD3>
  102.       <KEYWORD3>function</KEYWORD3>
  103.       <KEYWORD3>int</KEYWORD3>
  104.       <KEYWORD3>mapping</KEYWORD3>
  105.       <KEYWORD3>mixed</KEYWORD3>
  106.       <KEYWORD3>multiset</KEYWORD3>
  107.       <KEYWORD3>object</KEYWORD3>
  108.       <KEYWORD3>program</KEYWORD3>
  109.       <KEYWORD3>string</KEYWORD3>
  110.       <KEYWORD3>void</KEYWORD3>
  111.  
  112.       <!-- flow control and block-introducing keywords -->
  113.       <KEYWORD1>break</KEYWORD1>
  114.       <KEYWORD1>case</KEYWORD1>
  115.       <KEYWORD1>catch</KEYWORD1>
  116.       <KEYWORD1>continue</KEYWORD1>
  117.       <KEYWORD1>default</KEYWORD1>
  118.       <KEYWORD1>do</KEYWORD1>
  119.       <KEYWORD1>else</KEYWORD1>
  120.       <KEYWORD1>for</KEYWORD1>
  121.       <KEYWORD1>foreach</KEYWORD1>
  122.       <KEYWORD1>gauge</KEYWORD1>
  123.       <KEYWORD1>if</KEYWORD1>
  124.       <KEYWORD1>lambda</KEYWORD1>
  125.       <KEYWORD1>return</KEYWORD1>
  126.       <KEYWORD1>sscanf</KEYWORD1>
  127.       <KEYWORD1>switch</KEYWORD1>
  128.       <KEYWORD1>while</KEYWORD1>
  129.  
  130.       <!-- special instructions -->
  131.       <KEYWORD2>import</KEYWORD2>
  132.       <KEYWORD2>inherit</KEYWORD2>
  133.     </KEYWORDS>
  134.   </RULES>
  135.  
  136.   <RULES SET="COMMENT" IGNORE_CASE="FALSE" DEFAULT="COMMENT1">
  137.     <KEYWORDS>
  138.       <COMMENT2>FIXME</COMMENT2>
  139.       <COMMENT2>XXX</COMMENT2>
  140.     </KEYWORDS>
  141.   </RULES>
  142.  
  143.   <RULES SET="AUTODOC" IGNORE_CASE="TRUE" DEFAULT="COMMENT1">
  144.  
  145.         <EOL_SPAN TYPE="NULL" DELEGATE="MAIN" MATCH_TYPE="CONTEXT">@decl</EOL_SPAN>
  146.  
  147.         <!-- XML tags -->
  148.         <SPAN TYPE="MARKUP" DELEGATE="xml::TAGS">
  149.           <BEGIN>@xml{</BEGIN>
  150.             <END>@}</END>
  151.         </SPAN>
  152.         <!-- Cross references -->
  153.         <SPAN TYPE="FUNCTION" NO_LINE_BREAK="TRUE">
  154.           <BEGIN>@[</BEGIN>
  155.             <END>]</END>
  156.         </SPAN>
  157.  
  158.         <!-- Brace keywords -->
  159.         <SEQ_REGEXP TYPE="FUNCTION" HASH_CHAR="@">@(b|i|u|tt|url|pre|ref|code|expr|image)?(\{.*@\})</SEQ_REGEXP>
  160.  
  161.         <!-- Attempt to get syntax highlighting of @decl-ed functions
  162.              inside of the autodoc-rule.
  163.  
  164.              It works - but jEdit 4.1 has problems keeping it highlighted
  165.              (the syntax highlighting works depending on how you travel
  166.              past the @decl-ed region).
  167.              Can't figure aout how to to proper coloring of the @decl
  168.              keyword either.
  169.  
  170.              If there are problems with what regions are highlighted -
  171.              try to uncomment this first.
  172.         -->
  173.         <EOL_SPAN TYPE="NULL" DELEGATE="MAIN">@decl</EOL_SPAN>
  174.  
  175.         <KEYWORDS>
  176.           <!-- Meta keywords -->
  177.           <LABEL>@appears</LABEL>
  178.           <LABEL>@belongs</LABEL>
  179.           <LABEL>@class</LABEL>
  180.           <LABEL>@endclass</LABEL>
  181.           <LABEL>@example</LABEL>
  182.           <LABEL>@module</LABEL>
  183.           <LABEL>@endmodule</LABEL>
  184.           <LABEL>@namespace</LABEL>
  185.           <LABEL>@endnamespace</LABEL>
  186.           <!-- <LABEL>@decl</LABEL>
  187.           -->
  188.  
  189.           <!-- Single keywords -->
  190.           <LABEL>@deprecated</LABEL>
  191.  
  192.           <!-- Delimiter keywords -->
  193.           <LABEL>@note</LABEL>
  194.           <LABEL>@example</LABEL>
  195.           <LABEL>@bugs</LABEL>
  196.           <LABEL>@returns</LABEL>
  197.           <LABEL>@throws</LABEL>
  198.           <LABEL>@param</LABEL>
  199.           <LABEL>@seealso</LABEL>
  200.           <LABEL>@fixme</LABEL>
  201.           <LABEL>@constant</LABEL>
  202.           <LABEL>@member</LABEL>
  203.           <LABEL>@index</LABEL>
  204.           <LABEL>@elem</LABEL>
  205.           <LABEL>@value</LABEL>
  206.           <LABEL>@type</LABEL>
  207.           <LABEL>@item</LABEL>
  208.  
  209.           <!-- Container keywords -->
  210.           <LABEL>@section</LABEL>
  211.           <LABEL>@mapping</LABEL>
  212.           <LABEL>@endmapping</LABEL>
  213.           <LABEL>@multiset</LABEL>
  214.           <LABEL>@endmultiset</LABEL>
  215.           <LABEL>@array</LABEL>
  216.           <LABEL>@endarray</LABEL>
  217.           <LABEL>@int</LABEL>
  218.           <LABEL>@endint</LABEL>
  219.           <LABEL>@string</LABEL>
  220.           <LABEL>@endstring</LABEL>
  221.           <LABEL>@mixed</LABEL>
  222.           <LABEL>@endmixed</LABEL>
  223.           <LABEL>@dl</LABEL>
  224.           <LABEL>@enddl</LABEL>
  225.           <LABEL>@ol</LABEL>
  226.           <LABEL>@endol</LABEL>
  227.           <LABEL>@ul</LABEL>
  228.           <LABEL>@endol</LABEL>
  229.  
  230.           <!-- Special keywords -->
  231.           <LABEL>@ignore</LABEL>
  232.           <LABEL>@endignore</LABEL>
  233.  
  234.         </KEYWORDS>
  235.  
  236.     </RULES>
  237.  
  238.   <RULES SET="STRING_LITERAL" ESCAPE="\" IGNORE_CASE="TRUE" DEFAULT="LITERAL1">
  239.     <SEQ_REGEXP TYPE="LITERAL2" HASH_CHAR="%">%([^ a-z]*[a-z]|\[[^\]]*\])</SEQ_REGEXP>
  240.     <SEQ TYPE="COMMENT2">DEBUG:</SEQ>
  241.   </RULES>
  242. </MODE>